package InputPkg;

import javax.swing.JOptionPane;

public class PatternInput {
	
	PatternInput instance;
	private String patternStr;
	public PatternInput(){
		
	}
	public void getPatternInput(){
		patternStr = JOptionPane.showInputDialog(null,"Enter a pattern","Input dialog",JOptionPane.QUESTION_MESSAGE);
	}
	public String getPattern(){
		return patternStr;
	}
	
	public int analysis(String str){
		if(patternStr.startsWith("Max")){
			str = patternStr.trim().substring(3);
			return 1;
		}
		else if(patternStr.startsWith("Reg")){
			str = patternStr.trim().substring(3);
			return 2;
		}
		else{
			return 3;
		}
		
	}
	
	
}
